let app = getApp();
let httptool = require("../../utils/zry.httptool.js");
let tabjs = require("../../utils/tab.js");
Page({
  data:{
    fightImg:'',
    activeIndex: 1
  },
  daLei:function(e){
    httptool.login(function () {
      tabjs.daleiBtnClick();
    });
  },
  leiCircle: function () {
    wx.redirectTo({
      url: '/pages/index/index'
    });
  },
  myCenter: function () {
    wx.redirectTo({
      url: '/pages/myCenter/myCenter'
    });
  },
  onLoad:function(options){
    // 页面初始化 options为页面跳转所带来的参数
    let that=this;
    that.getImgUrl();
  },
  getImgUrl:function(e){
    let that=this;
     httptool.ajaxPost("api/BannerPicture/GetBannerPictureByType", {BannerType:'Fighting'}, function (res) { 
        if(res.suc){
            let datas=res.data;
            that.setData({fightImg:datas[0].ImgUrl});
        }
      })
  },
  onReady:function(){
    // 页面渲染完成
  },
  onShow:function(){
    // 页面显示
    if(wx.getStorageSync("boxStatus")== "查看成绩"){
      wx.redirectTo({
        url: '/pages/contestscore/contestscore'
      });
    }    
  },
  onHide:function(){
    // 页面隐藏
  },
  onUnload:function(){
    // 页面关闭
  }
})